Skip to content

Conversation

sujalsalekar
Copy link

Bounded Event Queues

Queue Size Limiting:
Event queues in several network behaviours are now bounded to a maximum size (MAX_EVENTS = 1024). When the queue reaches this limit, new events are dropped and a warning is logged. This change has been applied to the following modules:

  • protocols/floodsub/src/layer.rs
  • protocols/ping/src/lib.rs
  • protocols/perf/src/server/behaviour.rs
  • protocols/perf/src/client/behaviour.rs

Overflow Handling:
If the event queue is full, the system logs a warning message for each dropped event, providing visibility into potential overload situations and aiding in debugging.


Removal of Deprecated Relay Events

Cleaned Event API:
All deprecated event variants have been removed from the relay protocol’s Event enum in protocols/relay/src/behaviour.rs. This streamlines the event API and reduces maintenance overhead.

Internal Logging for Failures:
Event handling logic has been updated to use internal logging (tracing::warn!) instead of generating deprecated events, ensuring that important failure information is still captured without exposing deprecated API elements.


Copy link
Member

@elenaf9 elenaf9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

Bounded Event Queues

Queue Size Limiting:
Event queues in several network behaviours are now bounded to a maximum size (MAX_EVENTS = 1024). When the queue reaches this limit, new events are dropped and a warning is logged

This is not pushed yet, right?

Removal of Deprecated Relay Events

Cleaned Event API:
All deprecated event variants have been removed from the relay protocol’s Event enum in protocols/relay/src/behaviour.rs. This streamlines the event API and reduces maintenance overhead.

Internal Logging for Failures:
Event handling logic has been updated to use internal logging (tracing::warn!) instead of generating deprecated events, ensuring that important failure information is still captured without exposing deprecated API elements.

I know that there is issue #4757 for this and the items have already been deprecated, but tbh I am not sure if we should really remove the error events. There have been some people that spoke up about the usefulness of having these events (e.g. for metrics). And I am generally in favor of exposing more info rather than less to the user.
I don't think there is any downside or maintenance burden in keeping them.

@elenaf9 elenaf9 added kind/stale need/author-input Needs input from the original author and removed kind/stale labels Aug 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need/author-input Needs input from the original author
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants